package com.youhui.weixin.service;

import com.youhui.weixin.dao.TypesDao;
import com.youhui.weixin.domain.Goods;
import com.youhui.weixin.domain.Types;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类型Service.
 * User: huang
 * Date: 17-10-20
 */
@Service
public class TypesService {

    @Autowired
    private TypesDao typesDao;

    /**
     * 获取首页类型.
     * @return
     */
    public List<Types> getHomeTypes() {
        return typesDao.getHomeTypes();
    }

    /**
     * 获取类型.
     * @param typeId 类型编号
     * @return
     */
    public Types getTypeById(int typeId) {
        return typesDao.getTypesById(typeId);
    }

    /**
     * 获取所有分类.
     * @return
     */
    public List<Types> getAllTypes() {
        return typesDao.findAll();
    }
}
